package com.pomr.service.sys;

import java.util.List;

import com.pomr.model.form.RecordSelect;
import com.pomr.model.health.FriendTel;
import com.pomr.model.health.PersonRecord;
import com.pomr.model.sys.User;
import com.pomr.util.common.ResponseData;
import com.pomr.util.page.Page;
import org.springframework.web.bind.annotation.RequestBody;

public interface PersonRecordService {
	
	/**
	 * 新增一份个人档案
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public boolean insertRecord(PersonRecord record) throws Exception;
	
	/**
	 * 删除一份个人档案
	 * @param record 通过主键或身份证号
	 * @return
	 * @throws Exception
	 */
	public boolean deleteRecord(PersonRecord record) throws Exception;
	
	/**
	 * 批量删除档案
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public boolean deleteRecords(List<String> ids) throws Exception;
	
	/**
	 * 更新一份个人档案
	 * @param record 通过主键或身份证号
	 * @return
	 * @throws Exception
	 */
	public boolean updateRecord(PersonRecord record) throws Exception;
	
	/**
	 * 更改档案状态
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public boolean editRecordStatus(PersonRecord record) throws Exception;
	
	/**
	 * 批量更新档案
	 * @param record 通过主键或身份证号
	 * @return
	 * @throws Exception
	 */
	public boolean updateRecords(List<PersonRecord> records) throws Exception;
	
	/**
	 * 根据条件查询
	 * @param record
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<List<PersonRecord>> selectRecords(RecordSelect select,Page<List<PersonRecord>> page) throws Exception;
	
	/**
	 * 查询某份档案的详细信息  对于懒加载的内容立即加载
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public PersonRecord selectRecord(PersonRecord record) throws Exception;
	
	public Page<PersonRecord> selectByConditions() throws Exception;
	/**
	 * 身份证号是否已存在
	 * @param idcard
	 * @return
	 * @throws Exception
	 */
	public boolean searchPersonRecordByIdcard(String idcard) throws Exception;
	
	public boolean editRecord(PersonRecord record) throws Exception;
	/**
	 * 查询本机构 个人档案(未分配家庭的)
	 * @param tj
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public List<PersonRecord> searchRecords(String tj,User user) throws Exception;
	
	/**
	 * 根据条件查询未加入家庭档案的个人档案
	 * @param record
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<List<PersonRecord>> selectRecordsByConds(String limit, String page, String conds) throws Exception;
	/**
	 * 根据条件查询家庭成员
	 * @param record
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<List<PersonRecord>> selectRecordsByCondsOfFam(String limit, String page, String conds) throws Exception;
	
	/**
	 * 通过身份证号 查询健康档案
	 * @param page
	 * @param limit
	 * @param idcard
	 * @return
	 * @throws Exception
	 */
	public Page<List<PersonRecord>> searchUsersOfReceive(String page,String limit,String idcard) throws Exception;

	public List<PersonRecord> searchUsersOfReceive(String keywords) throws Exception;

	public ResponseData searchFriendTel(String recordid) throws Exception;

	public ResponseData searchFriendTelApp(String idcard) throws Exception;

	public ResponseData addFriendTel(FriendTel friendTel) throws Exception;

	public ResponseData deleteFriendTel(FriendTel friendTel) throws Exception;
}
